﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace stadt_verlangen
{
    class Score_Font
    {
        public SpriteFont font;
        public string text;
        public Vector2 position;

        public Score_Font(int newScore, Vector2 newPosition, SpriteFont newFont) 
        {
            //score wird nie größer als 999999.warum?deswegen!
            if (newScore < 10) 
            {
                text = "00000" + newScore.ToString();
            }
            else if (newScore < 100) 
            {
                text = "0000" + newScore.ToString();
            }
            else if (newScore < 1000) 
            {
                text = "000" + newScore.ToString();
            }
            else if (newScore < 10000) 
            {
                text = "00" + newScore.ToString();
            }
            else if (newScore < 100000)
            {
                text = "0" + newScore.ToString();
            }
            else 
            {
                text = newScore.ToString();
            }

            font = newFont;
            position = newPosition;
        }
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime) 
        {
            spriteBatch.DrawString(font,
                text,
                new Vector2(position.X + 1.0f, position.Y - 1.0f),
                Color.Black);
            spriteBatch.DrawString(font,
                text,
                position,
                Color.White);
        }
    }
}
